﻿// MIT License
// 开源地址：https://gitee.com/co1024/AbcMvc
// Copyright (c) 2021-2023 1024
// Abc.Mvc=Furion+EF+SqlSugar+Pear layui admin.

namespace Abc.Utils;
/// <summary>
/// ES 字符串扩展
/// </summary>
public static class EsStringExtension
{
    public static string GetIndex<T>(this string index) where T : class
    {
        return !string.IsNullOrWhiteSpace(index) ? index : typeof(T).Name.ToLower();
    }

    /// <summary>
    /// 首字母小写
    /// </summary>
    /// <param name="str"></param>
    /// <returns></returns>
    public static string ToFirstLower(this string str)
    {
        return str.Substring(0, 1).ToLower() + str[1..];
    }
}
